cmake_minimum_required(VERSION 3.10)
project(metrics)

SET(CMAKE_BUILD_TYPE "Debug")
#SET(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++11 -O0 -Wall -g")  # Debug模式下的编译指令
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -g")  # Release模式下的编译指令
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

aux_source_directory(src SRCS)
include_directories(${PROJECT_SOURCE_DIR})
link_libraries(jsoncpp rdkafka++ pthread)

add_executable(extrametrics tests/extrametrics.cpp ${SRCS})
add_executable(metrics tests/metrics.cpp ${SRCS})
add_executable(date tests/date.cpp ${SRCS})
add_executable(hash tests/hash.cpp ${SRCS})
add_executable(ConsoleMetricReporter tests/ConsoleMetricReporter.cpp ${SRCS})
add_executable(kafkaMetricReporter tests/kafkaMetricReporter.cpp ${SRCS})